package request

import "github.com/astaxie/beego/validation"

type ChangeShopCartRequest struct {
	BasketId           uint   `json:"basketId"`           //购物车ID
	ProdId             uint   `json:"prodId"`             //商品ID
	SkuId              uint   `json:"skuId"`              //SkuID
	ShopId             uint   `json:"shopId"`             //店铺ID
	Count              uint   `json:"count"`              //商品个数
	DistributionCardNo string `json:"distributionCardNo"` //分销推广人卡号
}

func (c *ChangeShopCartRequest) Valid(v *validation.Validation) {
	if c.ProdId < 1 {
		v.SetError("ProdId", "商品ID不能为空")
	} else if c.SkuId < 1 {
		v.SetError("SkuId", "skuId不能为空")
	} else if c.ShopId < 1 {
		v.SetError("ShopId", "店铺ID不能为空")
	} else if c.Count <= 0 {
		v.SetError("Count", "输入更改数量")
	}
}

/*
public class ChangeShopCartParam {

    @ApiModelProperty(value = "购物车ID", required = true)
    private Long basketId;

    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty(value = "商品ID", required = true)
    private Long prodId;

    @NotNull(message = "skuId不能为空")
    @ApiModelProperty(value = "skuId", required = true)
    private Long skuId;

    @NotNull(message = "店铺ID不能为空")
    @ApiModelProperty(value = "店铺ID", required = true)
    private Long shopId;

    @NotNull(message = "商品个数不能为空")
    @ApiModelProperty(value = "商品个数", required = true)
    private Integer count;

    @ApiModelProperty(value = "分销推广人卡号")
    private String distributionCardNo;
}
*/
